package com.fallback;

import com.hmall.api.client.TradeClient;
import com.hmall.common.exception.BizIllegalException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;

@Slf4j
public class TradeClientFallback implements FallbackFactory<TradeClient> {
    @Override
    public TradeClient create(Throwable cause) {
        return orderId -> {
            log.error("调用订单支付成功失败;具体参数为:{}",orderId, cause);
           throw new BizIllegalException("调用订单支付成功失败");
        };
    }
}
